import ProxyInterface from '../proxy-interface';
import { AccountPageModel, PublicAccountInfoModel } from '../model/account';

class AccountPageProxy implements ProxyInterface<AccountPageModel> {
  public accountPage = new AccountPageModel();

  constructor (responesData) {
    let data = responesData;
    Object.assign<AccountPageModel, any>(this.accountPage, data);
  }

  getModel (): AccountPageModel {
    return this.accountPage;
  }
}

class PublicAccountInfoProxy implements ProxyInterface<PublicAccountInfoModel> {
  private publicAccountInfo = new PublicAccountInfoModel()

  constructor (responseData) {
    let data = responseData.data || responseData
    Object.assign<PublicAccountInfoModel, any>(this.publicAccountInfo, data)
  }

  getModel (): PublicAccountInfoModel {
    return this.publicAccountInfo
  }
}


export {
  AccountPageProxy,
  PublicAccountInfoProxy
};
